| | |
| | | $this->processArrayFields($param); |
| | | |
| | | // 查找要编辑的名片 |
| | | $model = (new BusinessModel())->get($param['business_card_id']); |
| | | $model = (new BusinessModel())->where('business_card_id',$param['business_card_id'])->find(); |
| | | if (!$model) { |
| | | return $this->renderError('名片不存在'); |
| | | } |
| | |
| | | if (file_exists($image)) { |
| | | unlink($image); |
| | | } |
| | | |
| | | unset($param['sex']); |
| | | // 更新数据 |
| | | if ($model->save($param)) { |
| | | return $this->renderSuccess('编辑成功'); |
| | |
| | | public function detail($business_card_id) { |
| | | $data = BusinessModel::detail($business_card_id); |
| | | if ($data) { |
| | | $Qrcode = new Poster($data, 'business'); |
| | | $data['mp'] = $Qrcode->getImage(); |
| | | return $this->renderSuccess('', $data); |
| | | } |
| | | return $this->renderError('名片不存在'); |