| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\api\model\taxi;
- use app\common\model\BaseModel;
- class User extends BaseModel
- {
- protected $name = 'taxi_user';
- protected $insert = ['status' => 3,'remark' => '用户申请','created_at','updated_at'];
- protected $update = ['updated_at'];
- public function getIdCardImgAttr($value, $data)
- {
- if (isset($data['id_card_img']) && $data['id_card_img']) {
- $array = [];
- $idCardImg = json_decode($data['id_card_img'], true);
- foreach ($idCardImg as $item) {
- $array[] = [
- 'url' => $item
- ];
- }
- return $array;
- }
- return [];
- }
- public function setIdCardImgAttr($value, $data)
- {
- if (isset($data['id_card_img']) && $data['id_card_img']) {
- $array = explode(',', $data['id_card_img']);
- return json_encode($array);
- }
- return [];
- }
- }
|