|
|
@@ -54,8 +54,8 @@ class PublicAccount extends \yii\db\ActiveRecord
|
|
|
}
|
|
|
$sql = "select account,bank,name from crm_public_account where is_close = 0 and is_used = 0 order by id desc limit 1";
|
|
|
$account_arr = static::findBySql($sql)->asArray()->all();
|
|
|
- if(empty($account_arr)){
|
|
|
- return $account_arr;
|
|
|
+ if($account_arr){
|
|
|
+ return $account_arr[0];
|
|
|
}else{
|
|
|
$sql = "update crm_public_account set is_used = 1 where is_close = 1";
|
|
|
Yii::$app->db->createCommand($sql)->execute();
|