|
@@ -6,6 +6,7 @@ use app\admin\library\Auth;
|
|
|
use app\admin\model\Admin;
|
|
|
use app\common\controller\Backend;
|
|
|
use app\common\library\MobileConstant;
|
|
|
+use app\common\model\MobileSub;
|
|
|
use app\common\service\MobileImport;
|
|
|
use app\common\service\MobilePriceLogService;
|
|
|
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
|
@@ -822,16 +823,30 @@ class Mobile extends Backend
|
|
|
if(!$mobile){
|
|
|
return '';
|
|
|
}
|
|
|
+ $row=[
|
|
|
+ 'sort'=>0,
|
|
|
+ ];
|
|
|
if($this->request->isGet()){
|
|
|
- $this->assign('row',$mobile);
|
|
|
+ if($this->admin('sub')){
|
|
|
+ $row['sort']=MobileSub::getBy($mobile,$this->admin())['sub_sort'];
|
|
|
+ }else{
|
|
|
+ $row['sort']=$mobile['sort'];
|
|
|
+ }
|
|
|
+ $this->assign('row',$row);
|
|
|
return view();
|
|
|
}else{
|
|
|
$data=input('row/a');
|
|
|
$this->validate($data,[
|
|
|
'sort|排序'=>['require','integer','gt:0'],
|
|
|
]);
|
|
|
- $mobile['sort']=$data['sort'];
|
|
|
- $mobile->save();
|
|
|
+ if($this->admin('sub')){
|
|
|
+ $mobileSub=MobileSub::getBy($mobile,$this->admin());
|
|
|
+ $mobileSub['sub_sort']=$data['sort'];
|
|
|
+ $mobileSub->save();
|
|
|
+ }else{
|
|
|
+ $mobile['sort']=$data['sort'];
|
|
|
+ $mobile->save();
|
|
|
+ }
|
|
|
$this->success();
|
|
|
}
|
|
|
}
|