|
|
@@ -15,6 +15,7 @@ use common\components\util;
|
|
|
use Yii;
|
|
|
use yii\helpers\Json;
|
|
|
use bizHd\user\classes\UserClass;
|
|
|
+use \bizHd\device\classes\HdDeviceClass;
|
|
|
|
|
|
class AdminController extends BaseController
|
|
|
{
|
|
|
@@ -439,15 +440,22 @@ class AdminController extends BaseController
|
|
|
if (empty($clientId)) {
|
|
|
util::success(['returnStatus' => 'FAILURE']);
|
|
|
}
|
|
|
- $device = [
|
|
|
- 'clientId' => $clientId,
|
|
|
- 'mainId' => $this->mainId,
|
|
|
- 'shopId' => $this->shopId,
|
|
|
- 'adminId' => $this->adminId,
|
|
|
- 'loginTime' => date('Y-m-d H:i:s'),
|
|
|
- 'status' => 1
|
|
|
- ];
|
|
|
- \bizHd\device\classes\HdDeviceClass::add($device);
|
|
|
+
|
|
|
+ $hdDevice = HdDeviceClass::getByCondition(['clientId'=>$clientId], true);
|
|
|
+ if ($hdDevice == null) {
|
|
|
+ $device = [
|
|
|
+ 'clientId' => $clientId,
|
|
|
+ 'mainId' => $this->mainId,
|
|
|
+ 'shopId' => $this->shopId,
|
|
|
+ 'adminId' => $this->adminId,
|
|
|
+ 'loginTime' => date('Y-m-d H:i:s'),
|
|
|
+ 'status' => 1
|
|
|
+ ];
|
|
|
+ HdDeviceClass::add($device);
|
|
|
+ } else {
|
|
|
+ $hdDevice->loginTime = date("Y-m-d H:i:s");
|
|
|
+ $hdDevice->save();
|
|
|
+ }
|
|
|
|
|
|
noticeUtil::push("保存花店零售客户端ID:" . $clientId, '15280215347');
|
|
|
util::complete();
|