|
|
@ -16,6 +16,7 @@ use app\api\model\Agreement as AgreementModel; |
|
|
|
use app\api\model\User as UserModel; |
|
|
|
use app\api\model\User as UserModel; |
|
|
|
use app\api\model\Invite\InviteLog; |
|
|
|
use app\api\model\Invite\InviteLog; |
|
|
|
use app\common\service\qrcode\BaseQRcode; |
|
|
|
use app\common\service\qrcode\BaseQRcode; |
|
|
|
|
|
|
|
use app\store\model\MaintenanceCategory as MaintenanceCategoryModel; |
|
|
|
use app\store\model\User as StoreUserModel; |
|
|
|
use app\store\model\User as StoreUserModel; |
|
|
|
use app\api\model\user\BalanceLog; |
|
|
|
use app\api\model\user\BalanceLog; |
|
|
|
use app\api\model\user\GoodSource as GoodsSourceModel; |
|
|
|
use app\api\model\user\GoodSource as GoodsSourceModel; |
|
|
@ -397,26 +398,17 @@ class User extends Controller |
|
|
|
return $this->renderSuccess(str_replace(root_path() . "public/", base_url(), $qrcode)); |
|
|
|
return $this->renderSuccess(str_replace(root_path() . "public/", base_url(), $qrcode)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @throws ModelNotFoundException |
|
|
|
|
|
|
|
* @throws DataNotFoundException |
|
|
|
|
|
|
|
* @throws DbException |
|
|
|
|
|
|
|
*/ |
|
|
|
public function maintenance() |
|
|
|
public function maintenance() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$qrObj = new BaseQRcode(); |
|
|
|
|
|
|
|
$storeId = request()->header()['storeid']; |
|
|
|
$storeId = request()->header()['storeid']; |
|
|
|
$list = Db::table('yoshop_maintenance_category') |
|
|
|
$model = new MaintenanceCategoryModel; |
|
|
|
->where(['store_id' => $storeId, 'status' => 1,]) |
|
|
|
$list = $model->getList(['store_id' => $storeId])->toArray(); |
|
|
|
->select() |
|
|
|
|
|
|
|
->toArray(); |
|
|
|
|
|
|
|
foreach ($list as &$item) { |
|
|
|
|
|
|
|
$tags = []; |
|
|
|
|
|
|
|
$data = Db::table('yoshop_maintenance') |
|
|
|
|
|
|
|
->where(['category_id' => $item['id'], 'is_delete' => 0]) |
|
|
|
|
|
|
|
->select() |
|
|
|
|
|
|
|
->toArray(); |
|
|
|
|
|
|
|
foreach ($data as &$v) { |
|
|
|
|
|
|
|
$v['url_path'] = $v['url'] ? str_replace(root_path() . "public/", base_url(), $qrObj->getOtherQrcode((int)$storeId, $v['url'])) : ''; |
|
|
|
|
|
|
|
$tags[] = $v; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$item['tags'] = $tags; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $this->renderSuccess($list); |
|
|
|
return $this->renderSuccess($list); |
|
|
|
} |
|
|
|
} |
|
|
|