|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
+use app\common\service\MobileComputer;
|
|
|
use think\Model;
|
|
|
|
|
|
/**
|
|
@@ -41,6 +42,14 @@ class Mobile extends Model
|
|
|
{
|
|
|
self::beforeWrite(function (self $mobile){
|
|
|
$mobile['amount']=$mobile['amount_base']+$mobile['amount_charge'];
|
|
|
+
|
|
|
+ $mobile->data(array_merge($mobile->getData(),MobileComputer::setMobile($mobile['no'])->filter()));
|
|
|
+ });
|
|
|
+
|
|
|
+ self::afterInsert(function (self $mobile){
|
|
|
+ if(!$mobile->info()->find()){
|
|
|
+ $mobile->info()->save([]);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|