61 lines
1.2 KiB
PHP
61 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2020-12-2
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
|
|
namespace app\modules\api\models;
|
|
|
|
use function AlibabaCloud\Client\value;
|
|
use app\components\FlashStorage;
|
|
use app\components\SiteHelper;
|
|
use app\models\Coach;
|
|
use app\models\DeviceUniqueBindUser;
|
|
use app\models\Order;
|
|
use app\models\Store;
|
|
use app\models\User;
|
|
use app\components\auth\AToken;
|
|
use app\components\EncryptHelper;
|
|
use app\modules\api\components\ApiHelper;
|
|
use app\modules\api\components\GetDistance;
|
|
use yii\data\Pagination;
|
|
|
|
|
|
class OrderCountForm extends ApiModel
|
|
{
|
|
|
|
|
|
public $store_id;
|
|
public $user_type;
|
|
|
|
|
|
public function rules()
|
|
{
|
|
|
|
}
|
|
|
|
public function search()
|
|
{
|
|
if (empty($this->store_id)) {
|
|
return $this->apiReturnError('门店错误');
|
|
}
|
|
if ($this->user_type != 2) {
|
|
return $this->apiReturnError('权限错误');
|
|
}
|
|
|
|
$orderCount = Order::find()->where(['store_id' => $this->store_id, 'status' => 2, 'is_delete' => 0])->count();
|
|
return [
|
|
'code' => 0,
|
|
'msg' => 'ok',
|
|
'data' => ['num' => $orderCount]
|
|
];
|
|
}
|
|
|
|
|
|
} |