代支付记录
This commit is contained in:
@@ -37,7 +37,7 @@ class ChargeCashController extends BaseAdminController
|
||||
}
|
||||
|
||||
|
||||
$query->with(['store'])->orderBy(['id' => SORT_DESC]);
|
||||
$query->with(['store', 'supplier'])->orderBy(['id' => SORT_DESC]);
|
||||
$this->field = [
|
||||
ChargeCashPayRecord::class => [
|
||||
'id',
|
||||
@@ -46,7 +46,9 @@ class ChargeCashController extends BaseAdminController
|
||||
'charge_cash',
|
||||
'type',
|
||||
'status',
|
||||
'store',
|
||||
'store' => function ($query) {
|
||||
return empty($query->store)? $query->supplier: $query->store;
|
||||
},
|
||||
'created_at' => function ($le) {
|
||||
return date('Y-m-d H:i:s', $le->created_at);
|
||||
}
|
||||
|
||||
19
common/models/newDb/CardModel.php
Normal file
19
common/models/newDb/CardModel.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace common\models\newDb;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
|
||||
class CardModel extends \common\modelsgii\newDb\CardModelGii
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,9 @@ class SupplierModel extends \common\modelsgii\newDb\SupplierModelGii
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getCard()
|
||||
{
|
||||
return $this->hasOne(CardModel::class, ['user_id' => 'id']);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace common\models\oldDb;
|
||||
|
||||
use common\models\newDb\SupplierModel;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
@@ -27,4 +28,9 @@ class ChargeCashPayRecord extends \common\modelsgii\oldDb\ChargeCashPayRecord
|
||||
{
|
||||
return $this->hasOne(Store::class, ['id'=>'store_id']);
|
||||
}
|
||||
|
||||
public function getSupplier()
|
||||
{
|
||||
return $this->hasOne(SupplierModel::class, ['id'=>'store_id']);
|
||||
}
|
||||
}
|
||||
49
common/modelsgii/newDb/CardModelGii.php
Normal file
49
common/modelsgii/newDb/CardModelGii.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace common\modelsgii\newDb;
|
||||
|
||||
/**
|
||||
* This is the model class for table "yii_address".
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property string $name
|
||||
* @property string $mobile
|
||||
* @property string $province 省
|
||||
* @property string $city 市
|
||||
* @property string $area 区
|
||||
* @property string $region 省市区
|
||||
* @property string $detail_address 详细地址
|
||||
* @property int $is_default 是否默认地址0否1是
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
* @property int $deleted_at
|
||||
*/
|
||||
class CardModelGii extends \common\core\BaseNewActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return '{{%card}}';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user