| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace app\business;
- use Illuminate\Support\Arr;
- use support\Db;
- use support\Redis;
- class UserBusiness
- {
- /** 查询用户信息
- * @param $param
- * @return void
- */
- static public function userData($param)
- {
- try {
- $data=Db::table('wa_users')->where(function ($query)use ($param){
- if(Arr::get($param,'id')){
- $query->where('id',$param['id']);
- }
- if(Arr::get($param,'mobile')){
- $query->where('mobile',$param['mobile']);
- }
- })->first();
- if(empty($data)){
- throw new \Exception('账号不存在');
- }
- }catch (\Throwable $exception){
- throw new \Exception($exception->getMessage());
- }
- return collect($data)->toArray();
- }
- }
|